var markit_ie = (document.all);
var markit_sel; // Selection object needed for Firefox
var markit_range; // range object needed for Firefox
var markit_found = false;
var markit_finds = 0;
var markit_txt, markit_bookmark;
function findit(string) {
	if (markit_ie) {
		if (markit_txt == null) {
			markit_txt = document.body.createTextRange();
			markit_bookmark = new Array();
		}
		markit_bookmark[markit_finds] = markit_txt.getBookmark();
		if (string) // only call findText if there is a string or IE will have
			if (markit_found = markit_txt.findText(string)) // if found
			{
				markit_txt.select();
				markit_txt.scrollIntoView();
				markit_txt.collapse(false);
			} else {
				markit_finds--;
			}
	} else // Netscape or firefox
	{
		if (markit_finds > 0) {
			markit_sel = window.getSelection(); // get selection
			if (markit_sel.rangeCount > 0)
				markit_sel.removeAllRanges();
			markit_sel.addRange(markit_range);
		}
		if (string != "")
			markit_found = window.find(string, false, false);
		markit_sel = window.getSelection(); // get selection
		markit_range = markit_sel.getRangeAt(0); // get object
	}
	markit_finds++;
}

function findprev(string) {
	if (markit_ie) {
		if (markit_txt == null) {
			markit_txt = document.body.createTextRange();
			markit_bookmark = new Array();
		}
		if (markit_finds < 2) {
			markit_found = false;
			return;
		}
		markit_finds = markit_finds - 2;
		markit_txt.moveToBookmark(markit_bookmark[markit_finds]);
		findit(string);
	} else {
		if (markit_finds > 0) {
			markit_sel = window.getSelection(); // get selection
			if (markit_sel.rangeCount > 0)
				markit_sel.removeAllRanges();
			markit_sel.addRange(markit_range);
		}
		if (string != "")
			markit_found = window.find(string, false, true);
		markit_sel = window.getSelection(); // get selection
		markit_range = markit_sel.getRangeAt(0); // get object
	}
}